import requests

# 3、user-agent的使用

url = 'http://www.dianping.com/dpngyang/ch10'
header ={
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36'
}
c = requests.get(url,timeout=3,headers=header)
print(c)